﻿using System;
using System.Numerics;
using Windows.Foundation;

namespace TestApp2.Shaders
{
    public static class ShaderExtensions
    {

        //@Static
        public static Rect GetRect(Vector2 center, float radius)
        {
            float diameter = radius + radius;
            Rect rect = new Rect(center.X - radius, center.Y - radius, diameter, diameter);
            return rect;
        }
        public static Rect GetRect(Vector2 center, float radius, Rect region)
        {
            float diameter = radius + radius;
            Rect rect = new Rect(center.X - radius, center.Y - radius, diameter, diameter);
            rect.Intersect(region);
            return rect;
        }
        public static Rect GetRect(Vector2 a, Vector2 b, float radius)
        {
            float diameter = radius + radius;
            return new Rect(Math.Min(a.X, b.X) - radius, Math.Min(a.Y, b.Y) - radius, Math.Abs(a.X - b.X) + diameter, Math.Abs(a.Y - b.Y) + diameter);
        }
    }
}